package com.guqj.basis;

public class SynchronizedTest {

	public static void main(String[] args) {
		SynchronizedTest test = new SynchronizedTest();
		test.method1();
		SynchronizedTest.method2();
	}

	public static synchronized void method2() { // ACC_SYNCHRONIZED
		System.out.println("method2");
	}

	public void method1() {
		synchronized (this) { // monitorenter和monitorexit指令
			System.out.println("method1");
		}
	}
}
